using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class MasterPageTitleCtrl : UserControl
	{
		public static MasterPageTitleCtrl ctrlInstance;
		internal StackPanel TitlePanel;
		internal Image Cover;
		internal TextBlock MasterDesc;
		private bool _contentLoaded;
		public MasterPageTitleCtrl()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.MasterPageTitleCtrl_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.MasterPageTitleCtrl_Unloaded));
		}
		private void MasterPageTitleCtrl_Unloaded(object sender, RoutedEventArgs e)
		{
			MasterPageTitleCtrl.ctrlInstance = null;
		}
		private void MasterPageTitleCtrl_Loaded(object sender, RoutedEventArgs e)
		{
			MasterPageTitleCtrl.ctrlInstance = this;
		}
		public void SetContent(string desc, string slogan)
		{
			this.MasterDesc.set_Text(desc + "\n\n" + slogan);
		}
		public static void RefreshCover(string desc, string slogan)
		{
			if (MasterPageTitleCtrl.ctrlInstance == null)
			{
				return;
			}
			MasterPageTitleCtrl.ctrlInstance.SetContent(desc, slogan);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/Sns/Common/UI/AlbumCover/MasterPageTitleCtrl.xaml", 2));
			this.TitlePanel = (StackPanel)base.FindName("TitlePanel");
			this.Cover = (Image)base.FindName("Cover");
			this.MasterDesc = (TextBlock)base.FindName("MasterDesc");
		}
	}
}
